package com.shop.admin.job;


import com.shop.admin.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class UserGradeLevelJob {

    @Autowired
    private UserService userService;

    @Scheduled(cron = "0/30 * * * * ?")
    public void userLevelUpgrade(){
        int limit = 1000;
        log.info("--- 订单用户等级升级开始 ---");
        userService.userLevelUpgrade(limit);
        log.info("--- 订单用户等级升级结束 ---");
    }

}
